/* 报告子组件需要的字段 */
/* {
  //所有字段都是按需定义
  fieldValue: 'hello',
  label: '事件类型',
  placeholder: '请选择事件类型',
  //有无弹框
  hasPopup: true,
  // 显示弹框和数据源
  showPicker: false,
  columns: ['交通事故', '施工'],
  // 有无插槽
  type: 'upload',
  //显示规则
   rules: [{ required: true, message: '请填写用户名' }]
  //...插槽中需要绑定的数据
} */

import { ref } from 'vue'
import createStore from '@/store/index'

export const data = ref([
  {
    fieldValue: '',
    label: '事件类型',
    placeholder: '请选择事件类型',
    showPicker: false,
    columns: ['刮擦', '碰撞', '追尾', '其他'],
    hasPopup: true,
  },
  // {
  //   fieldValue: '',
  //   label: '事件等级',
  //   placeholder: '请选择事件等级',
  //   hasPopup: true,
  //   showPicker: false,
  //   columns: ['1', '2', '3', '4', '5'],
  // },
  {
    fieldValue: '',
    label: '事件地址',
    placeholder: '请填写事件地址',
    hasPopup: false,
    rules: [{ required: true, message: '地址不能为空' }],
  },
  {
    fieldValue: '',
    label: '图片上传',
    placeholder: '',
    hasPopup: false,
    type: 'upload',
  },

  {
    fieldValue: '',
    label: '事件描述',
    placeholder: '请填写事件描述',
    hasPopup: false,
    rules: [{ required: true, message: '描述不能为空' }],
  },
  {
    fieldValue: '',
    label: '建筑标识',
    placeholder: '请填写周围明显地标(选填)',
    hasPopup: false,
  },
])
export const onConfirm = (value, item) => {
  //console.log(value)
  //console.log(item)
  item.fieldValue = value
  item.showPicker = false
}
